<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<title>预授权订单</title>
		<link rel="stylesheet" href="./../public/css/common.css">
		<link rel="stylesheet" href="./../public/css/pintuer.css">
		<!-- 日历插件css -->
		<link rel="stylesheet" href="./../public/css/dcalendar.picker.css" />
		<!-- 账单汇总 -->
		<link rel="stylesheet" href="./css/deposit-order.css">
	</head>
	<body ms-controller="depositOrder">
		<div class="content">
			<div class="account_section ">
				<div class="line-big border section_common">
					<div class="x12">
						<!-- <div class="line-big bg-sub box-header">
							<div class="x8 title">
								预授权订单
							</div>
							<div class="x4 text-right">
								<a href="javascript:;"></a>
							</div>
						</div> -->
						<div class="line-big ">
							<div class="x12">
								<form action="account.do?act=account" name="myform" method="post">
									<div class="line-big am-form-group">
										<div class="am-form-left ">
											订单号
										</div>

										<div class="am-form-right">
											<input class="commoninput_date" type='text' value="" ms-duplex="@orderNumber" autocomplete="off"/>

										</div>
									</div>

									<div class="line-big am-form-group">
										<div class="am-form-left ">
											<span>日期范围：</span>

										</div>
										<div class="am-form-right "><input id='mydatepicker' class="commoninput_date" type='text' ms-duplex="startTime" autocomplete="off"/>
											<input id='mydatepicker2' class="commoninput_date" type='text' ms-duplex="endTime" autocomplete="off"/>
											<div class=" tips "> 提示:支持最大跨度31天的账单</div>
										</div>
									</div>
									<div class="line-big am-form-group">
										<div class="am-form-left ">
											收银员
										</div>

										<div class="am-form-right">
											<select class="commoninput" ms-duplex="@salepeople">
												<option value="全部">全部</option>
												<option ms-for="item in @salelist" ms-attr="{value: item.id}">{{item.nickname}}</option>

											</select>

										</div>
									</div>


									<div class="line-big am-form-group">


										<div class="">

											<button class="button bg-sub" type="button" ms-on-click="@serach()">
												<img class="loadimg" :class="showLoad ? '' : 'hide'"  src="./../public/images/load3.gif" />搜索</button>
											<button class="button n-option" type="button" ms-on-click="@higherserach('ishighermain')">
												<span class="icon-search"></span>高级搜索</button>

											<!-- <button class="button n-option" type="button" ms-on-click="@exportdata()">
												<span class="icon-folder-o"></span>导出数据</button> -->
										</div>
									</div>
									<div  class="higher-search" ms-class="@ishighermain?'showblock':'hide'">
										<div class="line-big am-form-group">
											<div class="am-form-left">
												备注信息
											</div>

											<div class="am-form-right">
												<input class="commoninput_date" type='text' value="" ms-duplex="@orderremark" autocomplete="off"/>

											</div>
										</div>
										<div class="line-big am-form-group">
											<div class="am-form-left">
												通道
											</div>

											<div class="am-form-right">
												<select class="commoninput" ms-duplex="@payway">
													<option value="">全部</option>
													<option value="alipay">支付宝支付通道</option>
													<option value="weixin">微信支付通道</option>
													<option value="sfbank">盛付通支付通道</option>

												</select>

											</div>
										</div>
										<div class="line-big am-form-group">
											<div class="am-form-left text-left">
												订单
											</div>

											<div class="am-form-right">
												<select class="commoninput" ms-duplex="@orderStatus">
													<option value="">全部</option>
													<option value="1">未结算</option>
													<option value="4">已结算</option>
													<option value="5">已解冻退回</option>
													<option value="2">授权失败</option>
												</select>

											</div>
										</div>
									</div>

								</form>
							</div>
						</div>
					</div>
				</div>
				<!-- 资金授权订单列表列表 -->
				<div class="line-big border section_common list-bill" :class="@isshowList? 'showblock':'hide'" >
					<div class="x12">
						<div class="line-big bg-sub box-header">
							<div class="x8 title">
								资金授权订单列表
							</div>
							<div class="x4 text-right">
								<a href="javascript:;"></a>
							</div>
						</div>
						<div class="line-big ">
							<div class="x12">
								<div class="table-responsive">
									<table class="table">
										<tr>
											<th>
												订单号
											</th>
											<th>
												时间
											</th>
											<th>消费帐户</th>
											<th>冻结金额</th>
											<th>
												实付金额
											</th>
											<th>
												备注
											</th>
											<th> 状态</th>
											<th>结算</th>
											<th>操作 </th>

										</tr>

										<tr ms-for="item in @list">
											<td>
												{{item.out_order_no}}
											</td>
											<td>
												{{item.created_at}}
											</td>

											<td>
												{{item.payer_logon_id?item.payer_logon_id:'--'}}
											</td>
											<td>
												{{item.amount}}
											</td>
											<td>
												{{item.pay_amount}}
											</td>
											<td>
												{{item.remark?item.remark:'--'}}
											</td>
											<td>
												{{item.accredit}}
											</td>
											<td>
												{{item.pay_status == 2? '授权失败' : item.pay_status == 3? '处理中' : item.pay_status == 4 ? '已结算' : item.unfreeze_status == 1? '已完成' : item.pay_status == 5 ? '已解冻退回' : '' }}
												<!-- {{item.pay_status == 4 ? '已结算' : ''}}
												{{item.pay_status == 5 ? '已解冻退回' : ''}}
												{{item.pay_status == 2 ?'授权失败' : ''}}
												{{item.pay_status == 3 ?'处理中' : ''}}
												{{item.unfreeze_status == 1? '已完成' : ''}}		 -->
												<span ms-class="item.pay_status == 1 && item.unfreeze_status == 0?'':'hide'">
													<a class="lookdetail" ms-click="Settlement(item.out_order_no,item.amount)">去结算</a>
													<a class="ml5 lookdetail" ms-click="returnMoney(item.out_order_no,item.amount)">全额退回</a>
												</span>

											</td>
											<td>
												<a class="lookdetail" 
												  ms-click="@orderDetailClick(item.out_order_no)">查看详情</a>
											</td>


										</tr>
									</table>
									<div ms-if="@total==0" class="no_data">--- 暂无数据 ---</div>
								</div>
							</div>
						</div>
						<!-- <div class="tongji">共计:{{@total}}条</div>
						<div class="page">
							<a class="pagePre" ms-class="@pageisshow ?'hide':'' " ms-on-click="pagepre">
								<<</a> <a ms-for="el in @totalpage" ms-class="[(@totalpage.length==1?'hide':''),(@page==el?'active':'')]"
								 ms-on-click="@pageto(el)">
									{{el}}
							</a>
							<a class="pageNext" ms-class="@pageisshow ?'hide':'' " ms-on-click="pagenext">>></a>
						</div> -->
						<div class="tongji">共计:{{@total}}条</div>
						<div class="page">
							<a class="pagePre " ms-class="@pageisshow ?'showblock':'hide' " ms-on-click="pagepre"><span>《</span></a> 
							<a ms-for="el in @totalpage" ms-class="[(@totalpage.length==1?'hide':''),(@page==el?'active':'')]"
								ms-on-click="@pageto(el)">
									{{el}}
							</a>
							<a class="pageNext " ms-class="@pageisshow ?'showblock':'hide' " ms-on-click="pagenext"><span>》</span></a>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="mask" :class='@setToggle? "openmask":""'></div>
		<!-- 消费结算弹框 -->
		<div class="dialog" :class='@setToggle? "open":""'>
			<div class="dialog-head">
				<strong>消费结算</strong>
			</div>
			<div class="dialog-body">
				<form>
					<div class="line-big am-form-group1">
						<div class="x3 text-left">
							授权金额
						</div>

						<div class="x9">
							<input class="commoninput_date" type='text' disabled ms-duplex="@preamountxf" />

						</div>
					</div>
					<div class="line-big am-form-group1">
						<div class="x3 text-left">
							消费金额
						</div>

						<div class="x9">
							<input class="commoninput_date" type='text' value="" ms-duplex="@amount" />

						</div>
					</div>
					<div class="line-big am-form-group1">
						<div class="x3 text-left">
							重要备注
						</div>

						<div class="x9">
							<input class="commoninput_date" type='text' value="" ms-duplex="@remarks" />

						</div>
					</div>
				</form>
			</div>
			<div class="dialog-foot">

				<button class="button button-small bg-blue" ms-click="@setSureClick()">
					确认</button>
				<button class="button button-small bg-blue ml10" ms-click="@setCloseClick()">
					关闭</button>
			</div>
		</div>
		<!-- 弹框 -->
		<div class="mask" :class='@toggle? "openmask":""'></div>
		<div class="dialog" :class='@toggle? "open":""'>
			<div class="dialog-head">
				<strong>确认把订单的金额退还给用户吗？</strong>
			</div>
			<div class="dialog-body">
				<form>
					<div class="line-big am-form-group">
						<div class="x3 text-left">
							授权金额
						</div>

						<div class="x9">
							<input class="commoninput_date" type='text' ms-duplex="@preamount" disabled />

						</div>
					</div>
					<div class="line-big am-form-group">
						<div class="x3 text-left">
							支付密码
						</div>

						<div class="x9">
							<input class="commoninput_date" type='password' value="" ms-duplex="@paypassword" />

						</div>
					</div>
					<div class="line-big am-form-group">
						<div class="x3 text-left">
							备注
						</div>

						<div class="x9">
							<input class="commoninput_date" type='text' value="" ms-duplex="@payremarks" />

						</div>
					</div>
				</form>
			</div>
			<div class="dialog-foot">

				<button class="button button-small bg-blue" ms-click="@sureClick()">
					确认</button>
				<button class="button button-small ml10" ms-click="@closeClick()">
					关闭</button>
			</div>
		</div>



	</body>
	<!-- api配置文档 -->
	<script src="./../api/api.js"></script>
	<!-- jquery -->
	<script src="./../public/js/jquery.js"></script>
	<!-- 拼图 js -->
	<script src="./../public/js/pintuer.js"></script>
	<!-- avalon js -->
	<script src="./../public/js/avalon.js"></script>
	<!-- 日历插件 -->
	<script type="text/javascript" src="./../public/js/dcalendar.picker.js"></script>
	<!-- common js -->
	<script src="./../public/js/common.js"></script>
	<!-- 账单汇总js -->
	<script src="./js/deposit-order.js"></script>
</html>
